<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Blade企业级开发平台-登录页</title>
		<link rel="shortcut icon" href="${ctxPath}/static/style/images/favicon.ico" type="image/x-icon" />
		<meta name="description" content="User login page" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="${ctxPath}/static/assets/css/bootstrap.css" />
		<link rel="stylesheet" href="${ctxPath}/static/assets/css/font-awesome.css" />
		<script src='${ctxPath}/static/assets/js/jquery.js'></script>
		<script type="text/javascript">
			$(function(){
				if(self != top){
					var url = window.location.href;
					parent.window.location.href = url;
				}
			});
		</script>
		<!-- text fonts -->
		<link rel="stylesheet" href="${ctxPath}/static/assets/css/ace-fonts.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="${ctxPath}/static/assets/css/ace.css" />
		<link rel="stylesheet" href="${ctxPath}/static/assets/css/ace-rtl.css" />
		<script src="${ctxPath}/static/layer/layer.js"></script>		
		<script src="${ctxPath}/static/blade/js/blade-ajax.js" type="text/javascript" ></script>
	</head>

	<body class="login-layout light-login">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">
							<div class="center">
								<h1>
									<span class="blue">Blade</span>
									<span class="grey" id="id-text2">FrameWork V1.0</span>
								</h1>
								<h4 class="blue" id="id-company-text">&copy; smallchill</h4>
							</div>
							<br>
							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="ace-icon fa fa-coffee blue"></i>
												请登录
											</h4>

											<div class="space-6"></div>

											<form method="post" data-imgcode="imgcode" action="${ctxPath}/login" id="loginform">
												<div class="input-group input-group-sx">
														<span class="input-group-addon">
															<i class="fa fa-user" style="width:15px;"></i>
														</span>
														<input type="text" name="account" class="form-control" placeholder="账号">
												</div>
												<br>
												<div class="input-group input-group-sx">
														<span class="input-group-addon">
															<i class="fa fa-unlock-alt" style="width:15px;"></i>
														</span>
														<input type="password" name="password" class="form-control" placeholder="密码">
												</div>
												<br>
												<div class="input-group input-group-sx">
														<span class="input-group-addon">
															<i class="fa fa-picture-o" style="width:15px;"></i>
														</span>
														<input type="text" name="imgCode" class="form-control" placeholder="验证码">
												
														<span class="input-group-btn">
															<img id="imgcode" src="${ctxPath}/captcha" onclick="this.src = '${ctxPath}/captcha?v=' + Math.random()" height="34" style="border: 1px solid #ccc;border-left: 0;cursor: pointer;" />
														</span>
												
												</div>
												<br>
												<div class="clearfix">
														<button type="reset" class="width-30 pull-left btn btn-sm btn-info">
															<i class="ace-icon fa fa-refresh"></i>
															<span class="bigger-110">重置</span>
														</button>

														<button type="submit" class="width-65 pull-right btn btn-sm btn-primary">
															<span class="bigger-110">登录</span>

															<i class="ace-icon fa fa-arrow-right icon-on-right"></i>
														</button>
													</div>
											</form>

										</div><!-- /.widget-main -->

										<div class="toolbar clearfix">
											<div>
												<a href="#" data-target="#forgot-box" class="forgot-password-link">
													<!-- <i class="ace-icon fa fa-arrow-left"></i>
													忘记密码 -->
												</a>
											</div>

											<div>
												<a href="#" data-target="#signup-box" class="user-signup-link">
													<!-- 注册
													<i class="ace-icon fa fa-arrow-right"></i> -->
												</a>
											</div>
										</div>
									</div><!-- /.widget-body -->
								</div><!-- /.login-box -->
							</div><!-- /.position-relative -->
						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div><!-- /.main-content -->
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='${ctxPath}/static/assets/js/jquery.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
		<script type="text/javascript">
		 window.jQuery || document.write("<script src='${ctxPath}/static/assets/js/jquery1x.js'>"+"<"+"/script>");
		</script>
		<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='${ctxPath}/static/assets/js/jquery.mobile.custom.js'>"+"<"+"/script>");
		</script>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
			
			$(function(){
				$("form").submit(function(){
					var $form = $(this);
					var $imgcode=$("#"+$form.attr("data-imgcode"));
					
					var ajax = new $ax($form.attr("action"), function(data){
						if (data.code === 0) {
							layer.msg(data.message, {shift: 1});
							setTimeout(function(){window.location.href = "${ctxPath}/";}, 1200);
							return false;
						} else {
							layer.msg(data.message, {shift: 6});
							$imgcode.click();
							return false;
						}
					});
					ajax.data = $form.serialize();
					ajax.start();
					
					return false;
				});
				 $(document).on('click', '.toolbar a[data-target]', function(e) {
						e.preventDefault();
						var target = $(this).data('target');
						$('.widget-box.visible').removeClass('visible');//hide others
						$(target).addClass('visible');//show target
				 });
			});
			
			
		</script>
	</body>
</html>



